/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-09-25  21:54
 */
public class Tank {
    //坦克速度
    public double speed = 50;
    //坦克炮弹数量
    public int bulletaAmount;
    //坦克加速
    public void speedUp(double speed) {
        this.speed += 10;
    }
    //坦克减速
    public void speeddown(double speed) {
        this.speed -= 10;
    }
    //坦克炮弹数量
    public void setBulletAmount(int num) {
        bulletaAmount = num;
    }
    //坦克开火
    public  void fire() {
        if(bulletaAmount > 0) {
            System.out.println("打出一个炮弹");
            bulletaAmount--;
        }else {
            System.out.println("打出失败，炮弹为0.");
        }
    }
}
